<?php

// Start Session
session_start();

//////////////////////////////////////////////////
//			Xtra Forum Software                           //
//			      Version 0.2.0                                   //
//		 -----------------------------------------	          //
//               Copyright 2008, Xtra Forum Software           //
//	        http://www.xtraforumsoftware.us.to/           //
/////////////////////////////////////////////////

?>

<?php

	// Include the Settings
	include('settings.php');
	// Now Include the Language File
	include('' .$settings['language_url']. '');
	// Include the Header file
	include('' .$settings['theme_url']. '/header.template.php');
	// Include the Main File
	include('' .$settings['theme_url']. '/main.template.php');
	// Include the Footer File
	include('' .$settings['theme_url']. '/footer.template.php');

	// Include the head
	Template_Header_Head();
	// Include the banner, and search
	Template_Header_Banner();
	// Include the Navigation
	Template_Header_Navigation();
	// Include the News Ticker
	Template_Header_NewsTicker();
	// Include the Guest or Member greeting
	if(isset($_SESSION['user']))
	{
		Template_Show_Member_Greeting();
	}
	else
	{
		Template_Show_Guest_Greeting();
	}

	// Now decide what files to include depending on the action variable
	// If user is viewing the index page then display the forums and stats
	if($action == "")
	{
		include('./Sources/forum_display.php');
		Template_Main_Categories(); // Include the main Categories
		Template_Main_Stats(); // Include the stats
	}
	// If the user is viewing the help page, then show them the help page
	else if($action == "Help")
	{
	
	}
	// If the user is viewing the search page, then show them the search page
	else if($action == "Search")
	{
	
	}
	// If the user is viewing the register page, then show them the register page
	else if($action == "Register")
	{
		Show_Register(); // Show the registration fields
	}
	else if($action == "Register2") // Ignore the 3 I did some changes and I will fix the 3 later.
	{
		include("./Sources/register.php"); // Include the register source
		Register_Submit(); // Include the Register_Submit function
	}
	// If the user is viewing the login page, then show them the login page
	else if($action == "Login")
	{
		Show_Login(); // Show the Login
	}
	else if($action == "Login2")
	{
		include("./Sources/login.php"); // Include the login source
		Check_Login(); // Include the Check_Login function
	}
	// If the user is trying to view a topic, then show them the topic
	else if($action == "ViewTopic")
	{
	
	}
	// Else show an error because something went wrong
	else
	{
		echo 'An Error has Occured. Error Code: 1'; // This basically shows an error when they set an action that does not work
	}
	// Now include the footer which is basically just the copyright and forum version
	Template_Footer();
?> 